package com.liuluo.homework1025hou.Controller

import com.liuluo.homework1025hou.domain.Articles
import com.liuluo.homework1025hou.service.ArticlesService
import org.springframework.web.bind.annotation.CrossOrigin
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@CrossOrigin("*")
@RequestMapping("/articles")
class ArticleController(private val articlesService:ArticlesService) {

    @GetMapping("/list")
    fun getAll():List<Articles>{
        return articlesService.getAllArticles()
    }
}